package com.techsoul.module.pms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.module.basic.pojo.entity.CustomerConsignee;
import com.techsoul.module.basic.pojo.entity.Warehouse;
import com.techsoul.module.basic.pojo.param.SuspiciousItemSaveParam;
import com.techsoul.module.basic.pojo.vo.WarehouseVo;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDelivery;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDeliveryLine;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialReceipt;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialReceiptLine;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialDeliveryLineSaveParam;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialReceiptLineSaveParam;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialReceiptLineSearchParam;
import com.techsoul.module.pms.pojo.vo.ChargeConfigVo;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryLineVo;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialReceiptLineVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 入库计划明细 Service接口
 * 
 * @author liuen
 * @date 2022-01-25
 */
public interface ITbWmsMaterialReceiptLineService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(TbWmsMaterialReceiptLineSaveParam params);
    TbWmsMaterialReceiptLine insertEntity(TbWmsMaterialReceiptLineSaveParam params);
    String moveToSuspicious(TbWmsMaterialReceiptLineSaveParam param);
    TbWmsMaterialReceipt generateMoveInWarehouseReceipt(String orderNo,TbWmsMaterialReceiptLine receiptline,
                       WarehouseVo frwarehouse, WarehouseVo towarehouse,UserVo user,TbWmsMaterialReceipt receipt);
    TbWmsMaterialDelivery generateMoveInWarehouseDelivery(TbWmsMaterialReceiptLine receiptline,
                      WarehouseVo towarehouse, CustomerConsignee customerConsignee,UserVo user,TbWmsMaterialReceipt receipt);

    TbWmsMaterialReceiptLine generateMoveInWarehouseReceiptLine(String orderNo,TbWmsMaterialReceiptLine receiptline,
                      WarehouseVo frwarehouse, WarehouseVo towarehouse,UserVo user,TbWmsMaterialReceipt receipt);
    TbWmsMaterialDeliveryLine generateMoveInWarehouseDeliveryLine(TbWmsMaterialReceiptLine receiptline,
                    WarehouseVo towarehouse, CustomerConsignee customerConsignee,UserVo user,TbWmsMaterialDelivery tbWmsMaterialDelivery);
    TbWmsMaterialDelivery generateDelivery(String orderNo,TbWmsMaterialReceiptLine receiptline, WarehouseVo frwarehouse, WarehouseVo towarehouse, UserVo user, TbWmsMaterialReceipt receipt);

    TbWmsMaterialDelivery generateDelivery(String orderNo,TbWmsMaterialReceiptLine receiptline, WarehouseVo frwarehouse, WarehouseVo towarehouse, UserVo user, TbWmsMaterialReceipt receipt,TbWmsMaterialDelivery delivery);
    TbWmsMaterialDeliveryLine generateDeliveryLine(String orderNo ,TbWmsMaterialReceiptLine receiptline,WarehouseVo frwarehouse, WarehouseVo towarehouse,UserVo user,TbWmsMaterialDelivery delivery,TbWmsMaterialDeliveryLine line);
    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(TbWmsMaterialReceiptLineSaveParam params);
    String generateArForReceipt(List<String> idList ) ;
    String generateArForDelivery(List<String> idList ) ;
    String generateWarehouseArForDelivery(List<String> idList ) ;

    String confirm(String id);
    String generateArForWarehouse(String customerNo,String month) ;
    String generateArForWarehouse(String month) ;
    Double getCustomerWarehouseArAmount(ChargeConfigVo chargeConfig,Double amt,UserVo userVo,String month);
    //仓储费出库是结算
    Double getCustomerWarehouseFeeArAmount(ChargeConfigVo chargeConfig,TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo,
                                           TbWmsMaterialReceiptLineVo tbWmsMaterialReceiptLineVo ,UserVo userVo) ;
    //配送费出库结算
    Double getCustomerWarehouseOutArAmount(ChargeConfigVo chargeConfig,TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo, UserVo userVo) ;
    //配送费入库结算
    Double getCustomerWarehouseInArAmount(ChargeConfigVo chargeConfig,TbWmsMaterialReceiptLineVo tbWmsMaterialReceiptLineVo, UserVo userVo) ;

    String generateArList(Double apamt,TbWmsMaterialReceiptLineVo tbWmsMaterialReceiptLineVo,UserVo userVo);
    String generateArList(Double apamt,TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo,UserVo userVo);
    String generateArList(Double apamt,TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo,TbWmsMaterialReceiptLineVo tbWmsMaterialReceiptLineVo,UserVo userVo);

    String generateArList(Double apamt,Double unitFee,Double qty,ChargeConfigVo chargeConfigVo,UserVo userVo,String month);
    /**
     * 详情
     * @param id
     * @return
     */
    TbWmsMaterialReceiptLineVo findById(String id);

    TbWmsMaterialReceiptLineVo getWithDeliverysAndArs(String id);
    /**
     * 列表
     * @param params
     * @return
     */
    List<TbWmsMaterialReceiptLineVo> findAll(TbWmsMaterialReceiptLineSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<TbWmsMaterialReceiptLineVo> findAll(TbWmsMaterialReceiptLineSearchParam params, Integer current, Integer pageSize);

    String importData(MultipartFile file);

    String exportData(TbWmsMaterialReceiptLineSearchParam params);
}
